<div class="bjui-pageContent">
<form action="{:U('cancelOrder')}" id="cancelOrderForm" class="pageForm" data-toggle="validate">
<input type="hidden" name="order_id" value="{:I('orderId')}">
<table class="tbl" width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#C9C9C9">
<tbody>
<tr>
<td bgcolor="#FFFFFF">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tbody>
        <tr>
            <td width="1" bgcolor="#C9C9C9"></td>
            <td valign="top">
                <div id="divProItemInfo">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                        <tr>
                            <td height="25" valign="top">
                                <table width="100%" border="0" cellspacing="0" cellpadding="10">
                                    <tbody>
                                    <tr>
                                        <input type="hidden" name="apple_cancel"
                                               value="{:I('urlFlagAppleCancel')}"/>
                                        <!--<input type="hidden" name="order_id" value="{$info.order_id}"/>-->
                                        <input type="hidden" name="status" value="{$info.status}"/>
                                        <input type="hidden" name="outbound_sn" value="{$info.outbound_sn}"/>
                                        <!-- 操作 -->
                                        <input type="hidden" name="opt_user_id" value="{$Think.UID}"/>
                                        <!-- 操作类型: ０未知CANCEL_OPT_UN，　１申请CANCEL_OPT_APPLE，　２审核APPLE_OPT_CHECK -->
                                        <input type="hidden" name="opt_type"
                                               value="<?php echo I('urlFlagAppleCancel') ? CANCEL_OPT_APPLE : APPLE_OPT_CHECK;?>"/>
                                        <td>
                                            <?php if($info['status']==ORDER_CANCEL):?>
                                                                  <span>
                                                                  <table width="450" border="0" cellpadding="10"
                                                                         cellspacing="1"
                                                                         bgcolor="#00A8FF">
                                                                      <tbody>
                                                                      <tr>
                                                                          <td bgcolor="#E2F5FF" class="size15"><span>同意取消！</span>
                                                                          </td>
                                                                      </tr>
                                                                      </tbody>
                                                                  </table>
                                                                      <table width="450" border="0" cellpadding="10"
                                                                             cellspacing="1"
                                                                             bgcolor="#EEEEDD"
                                                                             style="margin-top: 10px; table-layout: fixed; word-break: break-all; word-wrap: break-word;">
                                                                          <tbody>
                                                                          <tr>
                                                                              <td bgcolor="#FFFFEE"><span
                                                                                      class="size15"> 订单取消原因：</span>
                                                                                  <hr size="1">
                                                                              <span>{$info.cancel_reason}<br>
                                                                              <?php if($info['cancel_time']):?>
                                                                              申请取消时间：{$info.cancel_time|time_format}
                                                                              <?php endif;?>
                                                                              <div class="other">
                                                                                  取消时间：{$info.status_time|time_format}
                                                                              </div>
                                                                              </span>
                                                                              </td>
                                                                          </tr>
                                                                          </tbody>
                                                                      </table>
                                                                      </span>
                                            <!-- 申请取消订单情况 -->
                                            <?php elseif(I('urlFlagAppleCancel')):?>
                                            <?php if($info['apple_cancel'] == APPLE_CANCEL_NO || $info['apple_cancel'] == APPLE_CANCEL_FAIL):?>
                                            <!-- 申请取消订单 -->
                                                                          <span>
                                                                              <h2>申请取消订单</h2>
                                                                              <font
                                                                                      class="red">说明：如果要取消订单，请填写取消理由。</font>
                                                                          <div>
                                                                              <textarea name="reason" rows="6" cols="35" data-rule="取消原因:required;"  value=""></textarea>
                                                                          </div>
                                                                          <div style="margin-top: 5px;">
                                                                              <input type="submit"
                                                                                     name="btn_Cancel_Order"
                                                                                     value="取消订单"
                                                                                     class="btn btn-green">
                                                                          </div>
                                                                          </span>
                                            <?php elseif($info['apple_cancel'] >=APPLE_CANCEL_YES):?>
                                                                    <span>
                                                                      <table width="450" border="0" cellpadding="10"
                                                                             cellspacing="1"
                                                                             bgcolor="#00A8FF">
                                                                          <tbody>
                                                                          <tr>
                                                                              <td bgcolor="#E2F5FF" class="size15">
                                                                                  <span>申请取消成功！</span>
                                                                              </td>
                                                                          </tr>
                                                                          </tbody>
                                                                      </table>
                                                                      <table width="450" border="0" cellpadding="10"
                                                                             cellspacing="1"
                                                                             bgcolor="#EEEEDD"
                                                                             style="margin-top: 10px; table-layout: fixed; word-break: break-all; word-wrap: break-word;">
                                                                          <tbody>
                                                                          <tr>
                                                                              <td bgcolor="#FFFFEE"><span
                                                                                      class="size15"> 订单取消原因：</span>
                                                                                  <hr size="1">
                                                                              <span>{$info.cancel_reason}<br>
                                                                              申请取消时间：{$info.cancel_time|time_format}
                                                                              </span>
                                                                              </td>
                                                                          </tr>
                                                                          </tbody>
                                                                      </table>
                                                                      </span>
                                            <?php endif;?>
                                            <!-- 直接取消订单情况 -->
                                            <?php else:?>
                                            <!-- 已申请取消订单 -->
                                            <?php if($info['apple_cancel']==APPLE_CANCEL_YES):?>
                                                            <span>
                                                                      <table width="450" border="0" cellpadding="10"
                                                                             cellspacing="1"
                                                                             bgcolor="#EEEEDD"
                                                                             style="margin-top: 10px; table-layout: fixed; word-break: break-all; word-wrap: break-word;">
                                                                          <tbody>
                                                                          <tr>
                                                                              <td bgcolor="#FFFFEE"><span
                                                                                      class="size15"> 订单取消原因：</span>
                                                                                  <hr size="1">
                                                                              <span>{$info.cancel_reason}<br>
                                                                              申请取消时间：{$info.cancel_time|time_format}
                                                                              </span>
                                                                              </td>
                                                                          </tr>
                                                                          </tbody>
                                                                      </table>
                                                                      </span>
                                            <input type="button" value="同意取消订单" class="btn btn-green"
                                                   onclick="javascript:cancelOrderYes();">
                                            <input type="button" value="不同意取消订单" class="btn btn-green"
                                                   onclick="javascript:cancelOrderNo();">
                                            <?php else:?>
                                            <!-- 未申请取消订单 -->
                                            <!-- 已取消订单 -->
                                            <?php if($info['status']==ORDER_CANCEL):?>
                                                                  <span>
                                                                  <table width="450" border="0" cellpadding="10"
                                                                         cellspacing="1"
                                                                         bgcolor="#00A8FF">
                                                                      <tbody>
                                                                      <tr>
                                                                          <td bgcolor="#E2F5FF" class="size15"><span>同意取消！</span>
                                                                          </td>
                                                                      </tr>
                                                                      </tbody>
                                                                  </table>
                                                                      <table width="450" border="0" cellpadding="10"
                                                                             cellspacing="1"
                                                                             bgcolor="#EEEEDD"
                                                                             style="margin-top: 10px; table-layout: fixed; word-break: break-all; word-wrap: break-word;">
                                                                          <tbody>
                                                                          <tr>
                                                                              <td bgcolor="#FFFFEE"><span
                                                                                      class="size15"> 订单取消原因：</span>
                                                                                  <hr size="1">
                                                                              <span>{$info.cancel_reason}<br>
                                                                              申请取消时间：{$info.cancel_time|time_format}
                                                                              <div class="other">
                                                                                  取消时间：{$info.status_time|time_format}
                                                                              </div>
                                                                              </span>
                                                                              </td>
                                                                          </tr>
                                                                          </tbody>
                                                                      </table>
                                                                      </span>
                                            <?php else:?>
                                                                  <span>
                                                                      <?php echo $info.outbound_sn ? '<h2>取消出库订单</h2>' : '';?>
                                                                      <font class="red">说明：如果要取消订单，请填写取消理由。</font>
                                                                  <div>
                                                                      <textarea name="reason" rows="6" cols="35"data-rule="取消原因:required;" value=""></textarea>
                                                                  </div>
                                                                  <div style="margin-top: 5px;">
                                                                      <input type="submit" name="btn_Cancel_Order"
                                                                             value="取消订单"
                                                                             class="btn btn-green">
                                                                  </div>
                                                                  </span>
                                            <?php endif;?>
                                            <?php endif;?>
                                            <?php endif;?>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </td>
        </tr>
        </tbody>
    </table>
</td>
</tr>
</tbody>
</table>
</form>
</div>

<script>

    /**
     * 同意取消订单
     */
    function cancelOrderYes() {
        var _form = $.CurrentNavtab.find('#cancelOrderForm');   // 当前页面的form表单
        var apple_cancel = '{$Think.APPLE_CANCEL_SUCCESS}';
        $.CurrentNavtab.find('input[name=apple_cancel]').val(apple_cancel);
        $(_form).bjuiajax('ajaxForm')
    }

    /**
     * 不同意取消订单
     */
    function cancelOrderNo() {
        var _form = $.CurrentNavtab.find('#cancelOrderForm');   // 当前页面的form表单
        var apple_cancel = '{$Think.APPLE_CANCEL_FAIL}';
        $.CurrentNavtab.find('input[name=apple_cancel]').val(apple_cancel);
        $(_form).bjuiajax('ajaxForm')
    }


</script>

